package com.heima.admin.fein;

import com.heima.apis.wemedia.ManualCheckClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.SensitiveDto;
import com.heima.model.wemedia.pojos.WmSensitive;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/sensitive")
public class SensitiveFein {
    @Autowired
    private ManualCheckClient manualCheckClient;

    /**
     * 根据id删除
     *
     * @param id
     * @return
     */
    @DeleteMapping("/del/{id}")
    public ResponseResult delete(@PathVariable Integer id) {
     return    manualCheckClient.delete(id);

    }

    /**
     * 新增铭感词
     * @param wmSensitive
     * @return
     */
    @PostMapping("/save")
    public ResponseResult save(@RequestBody WmSensitive wmSensitive) {
      return manualCheckClient.save(wmSensitive);
    }

    /**
     * 根据id修改
     * @param wmSensitive
     * @return
     */
    @PostMapping("update")
    public ResponseResult update(@RequestBody WmSensitive wmSensitive)
    {
       return manualCheckClient.update(wmSensitive);
    }

    /**
     * 分页查询
     * @param sensitiveDto
     * @return
     */
    @PostMapping("/list")
    public ResponseResult list(@RequestBody() SensitiveDto sensitiveDto)
    {
     return manualCheckClient.list(sensitiveDto);
    }

}
